#!/bin/bash
APP_NAME='springboot-generator-web.jar'

tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
if [ ${tpid} ];then
    echo 'Stop Process...'
    kill -9 $tpid
fi

sleep 1

tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk '{print $2}'`

if [ ${tpid} ];then
    echo 'Kill Process!'
    kill -9 $tpid
else
    echo 'Stop Success!'
fi

